package com.cmict.data.form.api.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

import static com.cmict.data.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
* 字段信息 Base VO，提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
*/
@Data
public class MdColumnsBaseVO {

    @ApiModelProperty(value = "表id", required = true)
    @NotNull(message = "表id不能为空")
    private String tableId;

    @ApiModelProperty(value = "字段名", required = true)
    @NotNull(message = "字段名不能为空")
    private String columnName;

    @ApiModelProperty(value = "字段位置", required = true)
    @NotNull(message = "字段位置不能为空")
    private Long ordinalPosition;

    @ApiModelProperty(value = "字段内容是否为空")
    private String isNullable;

    @ApiModelProperty(value = "numeric_presision")
    private Long numericPrecision;

    @ApiModelProperty(value = "numeric_scale")
    private Long numericScale;

    @ApiModelProperty(value = "datetime_precision")
    private Long datetimePrecision;

    @ApiModelProperty(value = "character_set_name")
    private String characterSetName;

    @ApiModelProperty(value = "字段类型", required = true)
    @NotNull(message = "字段类型不能为空")
    private String columnType;

    @ApiModelProperty(value = "column_key")
    private String columnKey;

    @ApiModelProperty(value = "字段注释")
    private String columnComment;

    @ApiModelProperty(value = "创建时间", required = true)
    @NotNull(message = "创建时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改时间", required = true)
    @NotNull(message = "修改时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "是否删除,1删除，0未删除", required = true)
    @NotNull(message = "是否删除,1删除，0未删除不能为空")
    private Integer isDeleted;

    @ApiModelProperty(value = "qualifield_name", required = true)
    @NotNull(message = "qualifield_name不能为空")
    private String qualifieldName;

    @ApiModelProperty(value = "prefix_name", required = true)
    @NotNull(message = "prefix_name不能为空")
    private String prefixName;

}
